An optical system has been developed to measure the small motions of a person's head during a positron emission tomography (PET) scan in order to correct the scan and thereby improve the resolution of the image. The system uses two position-sensitive detectors to sense changes sequentially in the positions of three blinking miniature lamps that are fixed to the patient's head. The computer-controlled instrument computes the six degrees of freedom (three angles and three positions) that are necessary to characterize head movement.